JPEG (Joint Photographic Experts Group) is a commonly-used method for compressing and decompressing photographic images. The method typically involves downsampling the Y, Cb and Cr chroma components of the image, transforming the chroma components to the frequency domain, quantizing and then entropy-coding the result. Typically, the image is entropy-coded by run-length encoding the frequency domain components, and then Huffman-encoding the result. The JPEG standard allows for the use of general-purpose Huffman tables, or custom Huffman tables that have been optimized for the frequency-domain characteristics of the image.
JFIF (JPEG File Interchange Format) is the standardized image format for transmitting JPEG images across the Internet. According to this standard, the file header includes the Huffman table that was used to encode the image. Therefore, to decompress the image at its destination, the recipient device must first extract the Huffman table from the JPEG file, and then decode the image components using the extracted Huffman tree.
This procedure typically requires multiple main memory accesses to the Huffman tree until the image is completely decoded. As a result, decoding a JPEG file can be computationally expensive, resulting in poor performance on MIPS-constrained devices, such as handheld communications devices.